package gbench.appdemo.medicine.chemistry.particle;

import java.util.ArrayList;
import java.util.List;

/**
 * 粒子
 * 
 * @author gbench
 *
 */
public abstract class Particle extends Matter {

    /**
     * 
     * @param name 粒子的名称
     */
    public Particle(String name) {
        super(name);
    }
    
    /**
     * 
     * @param name 粒子的名称
     */
    public Particle(Matter matter) {
        super(matter.getName(),matter.getCharge());
    }
    
    /**
     * 
     * @param name 粒子的名称
     */
    public Particle(String name,Integer charge) {
        super(name,charge);
    }

    /**
     * 添加原子
     * @param atoms
     * @return
     */
    public Particle addAtom(Atom... atoms) {
        for (var a : atoms) {
            this.atoms.add(a);
        }
        return this;
    }
    
    public String toString() {
        return this.name+"["+this.charge+"]";
    }

    private List<Atom> atoms = new ArrayList<Atom>();
}
